package net.lzzy.practices.web;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.oas.annotations.EnableOpenApi;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

@Configuration
@EnableOpenApi
public class SwaggerConfig {
    private ApiInfo apiInfo(){
        return new ApiInfoBuilder()
                .description("苏俊节专用")
                .title("Practices接口文档1")
                .contact(new Contact("lzzy.retry","https:baidu.com","abc@lzzy.net"))
                .version("v1.0")
                .build();
    }
    @Bean
    public Docket docket(){
        return new Docket(DocumentationType.OAS_30).apiInfo(apiInfo()).enable(true).select().apis(RequestHandlerSelectors.basePackage("net.lzzy.practices.web")).paths(PathSelectors.any()).build();
    }
}
